#include "stdio.h"
main(){
	int  i,j,n,x1,y1,x2,y2,x3,y3,y4,x4,x5,x6,x,t1,t2;
	double y[4];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%d%d%d%d%d%d%d",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
		t1=x1<x2?x1:x2;t2=x3<x4?x3:x4;
		x5=t1>t2?t1:t2;
		t1=x1>x2?x1:x2;t2=x3>x4?x3:x4;
		x6=t1<t2?t1:t2;
		if(x6<x5){printf("n\n");continue;}
		else if(x5==x6){
			if((y2>y1?y2:y1)>=(y3<y4?y3:y4)&&(y2<y1?y2:y1)<=(y3>y4?y3:y4))
			{printf("y\n");continue;}
			else
			{printf("n\n");continue;}
		}
		if(x1==x2){y[0]=y1;y[1]=y2;}
		else if(y1==y2){y[0]=y[1]=y1;}
		else{
		y[0]=(double)(x5-x1)*(y2-y1)/(x2-x1)+y1;
		y[1]=(double)(x6-x1)*(y2-y1)/(x2-x1)+y1;
		}
		if(x3==x4){y[2]=y3;y[3]=y4;}
		else if(y3==y4){y[2]=y[3]=y4;}
		else{
		y[2]=(double)(x5-x3)*(y4-y3)/(x4-x3)+y3;
		y[3]=(double)(x6-x3)*(y4-y3)/(x4-x3)+y3;
		}

		if(y[0]<=y[2]){
			if(y[0]==y[2]||y[1]>=y[3]){
				printf("y\n");continue;
			}
			else{
				printf("n\n");continue;
			}
		}
		else if(y[0]>=y[2]){
			if(y[0]==y[2]||y[1]<=y[3]){
				printf("y\n");
			}
			else{
				printf("n\n");
			}
		}
	}
}